package com.lanou.quanttradedata.stock.mapper;

import com.lanou.quanttradedata.stock.javabean.StockDailyInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StockDailyInfoMapper {
    /**
     * 向数据库插入多条日线信息
     * @param stockDailyInfos
     * @return
     */
    int insertStockDailyInfos(@Param("list") List<StockDailyInfo> stockDailyInfos);

    /**
     * 根据tradedate查询符合要求的日线数据
     * @param tradedate
     * @return
     */
    List<StockDailyInfo> getStockDailyInfoListByTradedate(@Param("tradedate") String tradedate);

    /**
     * 统计总共有几天日线数据
     * @return
     */
    int countTradeDate();

    /**
     * 删除最早一天的所有日线数据
     * @return
     */
    int delStockDailyInfosOfEarliestTradeDate();
}
